package com.woniuxy.core.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.entity.AllArticle;
import com.woniuxy.entity.AllShop;
import com.woniuxy.entity.DTO.ShopAndUserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Author hq
 * @Date 2025/7/13$ 15:55$
 * @Description TODO
 * @Params $
 * @Return $
 **/
@Mapper
public interface ShopMapper extends BaseMapper<AllShop> {
    //修改state状态，同时更新修改时间
    @Update("update all_shop set status = #{status}, update_time = now() where id = #{id}")
    void updateStatus(@Param("id") Integer id, @Param("status") int status);

    Page<ShopAndUserDTO> selectShopsWithUserInfo(@Param("page") Page<ShopAndUserDTO> page,@Param("title") String title,@Param("typeId") Integer typeId);
    @Select("select * from all_shop where id = #{id}")
    AllShop getShopById(Integer id);
}
